#define _CRT_SECURE_NO_WARNINGS 1


#include <stdio.h>

int KengSort(int* a, int begin, int end)
{
	int key = a[begin];
	int keng = begin;
	while (begin < end)
	{
		if (begin < end && a[end] >= key)
		{
			--end;
		}
		a[keng] = a[end];
		keng = end;
		while (begin < end && a[begin] <= key)
		{
			++begin;
		}
		a[keng] = a[begin];
		keng = begin;
	}
	a[keng] = key;
	return keng;
}

int main()
{
	return 0;
}